<cfcomponent displayname="User" output="false">


	<!---
	PROPERTIES
	--->
	<cfset variables.instance = StructNew() />

	<!---
	INITIALIZATION / CONFIGURATION
	--->
	<cffunction name="init" access="public" returntype="tar.model.user" output="false">
		<cfargument name="userid" 		type="string" required="false" default="" />
		<cfargument name="username" 	type="string" required="false" default="" />
		<cfargument name="email" 			type="string" required="false" default="" />
		<cfargument name="firstname" 	type="string" required="false" default="" />
		<cfargument name="lastname" 	type="string" required="false" default="" />
		<cfargument name="roles" 			type="string" required="false" default="" />

		<!--- run setters --->
		<cfset setUserid(arguments.userid) />
		<cfset setUsername(arguments.username) />
		<cfset setEmail(arguments.email) />
		<cfset setFirstname(arguments.firstname) />
		<cfset setLastname(arguments.lastname) />
		<cfset setRoles(arguments.roles) />

		<cfreturn this />
 	</cffunction>

	<!---
	ACCESSORS
	--->
	<cffunction name="setUserid" access="public" returntype="void" output="false">
		<cfargument name="userid" type="string" required="true" />
		<cfset variables.instance.userid = arguments.userid />
	</cffunction>
	<cffunction name="getUserid" access="public" returntype="string" output="false">
		<cfreturn variables.instance.userid />
	</cffunction>

	<cffunction name="setUsername" access="public" returntype="void" output="false">
		<cfargument name="username" type="string" required="true" />
		<cfset variables.instance.username = arguments.username />
	</cffunction>
	<cffunction name="getUsername" access="public" returntype="string" output="false">
		<cfreturn variables.instance.username />
	</cffunction>

	<cffunction name="setEmail" access="public" returntype="void" output="false">
		<cfargument name="email" type="string" required="true" />
		<cfset variables.instance.email = arguments.email />
	</cffunction>
	<cffunction name="getEmail" access="public" returntype="string" output="false">
		<cfreturn variables.instance.email />
	</cffunction>

	<cffunction name="setFirstname" access="public" returntype="void" output="false">
		<cfargument name="firstname" type="string" required="true" />
		<cfset variables.instance.firstname = arguments.firstname />
	</cffunction>
	<cffunction name="getFirstname" access="public" returntype="string" output="false">
		<cfreturn variables.instance.firstname />
	</cffunction>

	<cffunction name="setLastname" access="public" returntype="void" output="false">
		<cfargument name="lastname" type="string" required="true" />
		<cfset variables.instance.lastname = arguments.lastname />
	</cffunction>
	<cffunction name="getLastname" access="public" returntype="string" output="false">
		<cfreturn variables.instance.lastname />
	</cffunction>

	<cffunction name="setRoles" access="public" returntype="void" output="false">
		<cfargument name="roles" type="string" required="true" />
		<cfset variables.instance.roles = arguments.roles />
	</cffunction>
	<cffunction name="getRoles" access="public" returntype="string" output="false">
		<cfreturn variables.instance.roles />
	</cffunction>

</cfcomponent>